<template>
  <div class="container">
    <div class="containerbox">
      <!-- <h1 class="title" @click="clickaaaaa()">
        {{ msg }}
      </h1> -->
      <div class="links">
        <nuxt-link to="/" class="button--green">首页1</nuxt-link>
      </div>

      <el-collapse v-model="activeNames" @change="handleChange">
        <el-collapse-item
          :title="item.author"
          v-for="(item, index) in dataList.data"
          :name="index"
          :key="index"
        >
          <div>
            {{ item.author }}
          </div>
          <div>
            在界面中一致：所有的元素和结构需保持一致，比如：设计样式、图标和文本、元素的位置等。
          </div>
        </el-collapse-item>
      </el-collapse>
    </div>
  </div>
</template>

<script>
// import { mapState } from 'vuex';
export default {
  // async asyncData(context) {
  //   let { data } = await context.$axios.get('/api/blog/list')
  //   return {
  //     tableData: data.data,
  //   }
  // },
  name: 'HelloWorld',
  computed: {
    // ...mapState({
    //   dataList: (state) => state.dataList,
    // }),
  },
  data() {
    return {
      msg: 'HelloWorld',
      activeNames: '',
      dataList: [],
    }
  },
  mounted() {
    this.$axios.get('/api/blog/list').then((res) => {
      this.dataList = res.data
    })
  },
  methods: {
    handleChange() {},
  },
}
</script>

<style scoped>
.container {
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.containerbox {
  width: 600px;
  margin: 0 auto;
}

.title {
  font-family: 'Quicksand', 'Source Sans Pro', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: block;
  font-weight: 300;
  font-size: 100px;
  color: #35495e;
  letter-spacing: 1px;
}

.subtitle {
  font-weight: 300;
  font-size: 42px;
  color: #526488;
  word-spacing: 5px;
  padding-bottom: 15px;
}

.links {
  padding-top: 15px;
  margin-bottom: 50px;
}
</style>
